package com.jiajia.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jiajia.server.pojo.Admin;
import com.jiajia.server.pojo.AdminLoginParm;
import com.jiajia.server.pojo.RespBean;
import com.jiajia.server.pojo.Role;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jiajia
 * @since 2021-08-10
 */
public interface IAdminService extends IService<Admin> {
    /**
     * 登录之后返回token
     * @param adminLoginParm
     * @param request
     * @return
     */
    RespBean login(AdminLoginParm adminLoginParm, HttpServletRequest request);

    /**
     * 返回登录信息
     * @param username
     * @return
     */
    Admin getAdminByUserName(String username);

    /**
     * 根据用户id查询角色
     */
    List<Role> getRole(Integer adminId);

    /**
     * 查询操作员
     * @param keyword
     * @return
     */
    List<Admin> getAllAdmin(String keyword);

    /**
     * 更新操作员角色
     * @param id
     * @param ids
     * @return
     */
    RespBean updateAdminRole(Integer id, Integer[] ids);

    RespBean updatePassWord(String oldPass, String pass, Integer adminId);

    RespBean updateUserFace(String url, Integer id, Authentication authentication);
}
